3.289 \(\int \frac{\tan ^3(c+d x)}{a+b \sec (c+d x)} \, dx\)

Optimal. Leaf size=59 \[ -\frac{\left (a^2-b^2\right ) \log (a+b \sec (c+d x))}{a b^2 d}+\frac{\log (\cos (c+d x))}{a d}+\frac{\sec (c+d x)}{b d} \]

[Out]

Log[Cos[c + d*x]]/(a*d) - ((a^2 - b^2)*Log[a + b*Sec[c + d*x]])/(a*b^2*d) + Sec[c + d*x]/(b*d)

________________________________________________________________________________________

Rubi [A]  time = 0.0710039, antiderivative size = 59, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.095, Rules used = {3885, 894} \[ -\frac{\left (a^2-b^2\right ) \log (a+b \sec (c+d x))}{a b^2 d}+\frac{\log (\cos (c+d x))}{a d}+\frac{\sec (c+d x)}{b d} \]

Antiderivative was successfully verified.

[In]

Int[Tan[c + d*x]^3/(a + b*Sec[c + d*x]),x]

[Out]

Log[Cos[c + d*x]]/(a*d) - ((a^2 - b^2)*Log[a + b*Sec[c + d*x]])/(a*b^2*d) + Sec[c + d*x]/(b*d)

Rule 3885

Int[cot[(c_.) + (d_.)*(x_)]^(m_.)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_), x_Symbol] :> -Dist[(-1)^((m - 1
)/2)/(d*b^(m - 1)), Subst[Int[((b^2 - x^2)^((m - 1)/2)*(a + x)^n)/x, x], x, b*Csc[c + d*x]], x] /; FreeQ[{a, b
, c, d, n}, x] && IntegerQ[(m - 1)/2] && NeQ[a^2 - b^2, 0]

Rule 894

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIn
tegrand[(d + e*x)^m*(f + g*x)^n*(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, f, g}, x] && NeQ[e*f - d*g, 0] &&
NeQ[c*d^2 + a*e^2, 0] && IntegerQ[p] && ((EqQ[p, 1] && IntegersQ[m, n]) || (ILtQ[m, 0] && ILtQ[n, 0]))

Rubi steps

\begin{align*} \int \frac{\tan ^3(c+d x)}{a+b \sec (c+d x)} \, dx &=-\frac{\operatorname{Subst}\left (\int \frac{b^2-x^2}{x (a+x)} \, dx,x,b \sec (c+d x)\right )}{b^2 d}\\ &=-\frac{\operatorname{Subst}\left (\int \left (-1+\frac{b^2}{a x}+\frac{a^2-b^2}{a (a+x)}\right ) \, dx,x,b \sec (c+d x)\right )}{b^2 d}\\ &=\frac{\log (\cos (c+d x))}{a d}-\frac{\left (a^2-b^2\right ) \log (a+b \sec (c+d x))}{a b^2 d}+\frac{\sec (c+d x)}{b d}\\ \end{align*}

Mathematica [A]  time = 0.120668, size = 52, normalized size = 0.88 \[ \frac{\left (b^2-a^2\right ) \log (a \cos (c+d x)+b)+a^2 \log (\cos (c+d x))+a b \sec (c+d x)}{a b^2 d} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[c + d*x]^3/(a + b*Sec[c + d*x]),x]

[Out]

(a^2*Log[Cos[c + d*x]] + (-a^2 + b^2)*Log[b + a*Cos[c + d*x]] + a*b*Sec[c + d*x])/(a*b^2*d)

________________________________________________________________________________________

Maple [A]  time = 0.041, size = 70, normalized size = 1.2 \begin{align*} -{\frac{a\ln \left ( b+a\cos \left ( dx+c \right ) \right ) }{d{b}^{2}}}+{\frac{\ln \left ( b+a\cos \left ( dx+c \right ) \right ) }{ad}}+{\frac{a\ln \left ( \cos \left ( dx+c \right ) \right ) }{d{b}^{2}}}+{\frac{1}{db\cos \left ( dx+c \right ) }} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(d*x+c)^3/(a+b*sec(d*x+c)),x)

[Out]

-1/d/b^2*a*ln(b+a*cos(d*x+c))+1/d/a*ln(b+a*cos(d*x+c))+1/d/b^2*a*ln(cos(d*x+c))+1/d/b/cos(d*x+c)

________________________________________________________________________________________

Maxima [A]  time = 0.971969, size = 77, normalized size = 1.31 \begin{align*} \frac{\frac{a \log \left (\cos \left (d x + c\right )\right )}{b^{2}} - \frac{{\left (a^{2} - b^{2}\right )} \log \left (a \cos \left (d x + c\right ) + b\right )}{a b^{2}} + \frac{1}{b \cos \left (d x + c\right )}}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^3/(a+b*sec(d*x+c)),x, algorithm="maxima")

[Out]

(a*log(cos(d*x + c))/b^2 - (a^2 - b^2)*log(a*cos(d*x + c) + b)/(a*b^2) + 1/(b*cos(d*x + c)))/d

________________________________________________________________________________________

Fricas [A]  time = 0.929986, size = 161, normalized size = 2.73 \begin{align*} \frac{a^{2} \cos \left (d x + c\right ) \log \left (-\cos \left (d x + c\right )\right ) -{\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right ) \log \left (a \cos \left (d x + c\right ) + b\right ) + a b}{a b^{2} d \cos \left (d x + c\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^3/(a+b*sec(d*x+c)),x, algorithm="fricas")

[Out]

(a^2*cos(d*x + c)*log(-cos(d*x + c)) - (a^2 - b^2)*cos(d*x + c)*log(a*cos(d*x + c) + b) + a*b)/(a*b^2*d*cos(d*
x + c))

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\tan ^{3}{\left (c + d x \right )}}{a + b \sec{\left (c + d x \right )}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)**3/(a+b*sec(d*x+c)),x)

[Out]

Integral(tan(c + d*x)**3/(a + b*sec(c + d*x)), x)

________________________________________________________________________________________

Giac [B]  time = 1.97962, size = 267, normalized size = 4.53 \begin{align*} -\frac{\frac{{\left (a^{3} - a^{2} b - a b^{2} + b^{3}\right )} \log \left ({\left | a + b + \frac{a{\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} - \frac{b{\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} \right |}\right )}{a^{2} b^{2} - a b^{3}} + \frac{\log \left ({\left | -\frac{\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} + 1 \right |}\right )}{a} - \frac{a \log \left ({\left | -\frac{\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} - 1 \right |}\right )}{b^{2}} + \frac{a - 2 \, b + \frac{a{\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1}}{b^{2}{\left (\frac{\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} + 1\right )}}}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^3/(a+b*sec(d*x+c)),x, algorithm="giac")

[Out]

-((a^3 - a^2*b - a*b^2 + b^3)*log(abs(a + b + a*(cos(d*x + c) - 1)/(cos(d*x + c) + 1) - b*(cos(d*x + c) - 1)/(
cos(d*x + c) + 1)))/(a^2*b^2 - a*b^3) + log(abs(-(cos(d*x + c) - 1)/(cos(d*x + c) + 1) + 1))/a - a*log(abs(-(c
os(d*x + c) - 1)/(cos(d*x + c) + 1) - 1))/b^2 + (a - 2*b + a*(cos(d*x + c) - 1)/(cos(d*x + c) + 1))/(b^2*((cos
(d*x + c) - 1)/(cos(d*x + c) + 1) + 1)))/d